<aside class="main-sidebar">
    <!-- sidebar: style can be found in sidebar.less -->
    <div class="row" style="margin:15px;color:#FFF;">
        <div class="form-group">
            <label class="col-sm-5 control-label">API版本</label>
            <div class="col-sm-7">
                <select name="" class="form-control" onchange="changeVersion(this);">
                    {volist name="allowVersions" id="v"}
                    <option>{$v}</option>
                    {/volist}
                </select>
            </div>
        </div>
    </div>
    <section class="sidebar">
        <!-- sidebar menu: : style can be found in sidebar.less -->
        <ul class="sidebar-menu" data-widget="tree">
            {volist name="menus" id="v"}
            {if (!empty($v['_child']))}
            <li class="treeview menu-open {if condition="(count($menus_curr) egt 1) AND ($menus_curr[0] eq $v['id'])"}active{/if}">
                <a href="javascript:;">
                    <i class="fa fa-folder"></i><span> {$v['title']}</span>
                    <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                </a>
                <ul class="treeview-menu" style="display: block;">
                    <!--二级菜单遍历开始-->
                    {volist name="v._child" id="vv"}{if condition="!empty($vv['_child'])"}
                    <li class="treeview menu-open {if condition="(count($menus_curr) egt 2) AND ($menus_curr[1] eq $vv['id'])"}active menu-open{/if}">
                        <a href="javascript:;">
                            <i class="fa fa-circle-o"></i> {$vv['title']}<span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                        </a>
                        <ul class="treeview-menu" style="display: block;">
                            <!--三级菜单遍历开始-->
                            {volist name="vv._child" id="vvv"}
                            <li class="{if condition="(count($menus_curr) egt 3) AND ($menus_curr[2] eq $vvv['id'])"}active{/if}">
                                <a href="{$vvv['name']}"><i class="fa fa-circle-o"></i> {$vvv['title']}</a>
                            </li>
                            {/volist}
                        </ul>
                    </li>
                    {else /}
                    <li class="menu-open {if condition="(count($menus_curr) egt 2) AND ($menus_curr[1] eq $vv['id'])"}active{/if}">
                        <a href="{$vv['name']}"><i class="fa fa-circle-o"></i> {$vv['title']}</a>
                    </li>
                    {/if}
                    {/volist}
                </ul>
            </li>
            {else /}
            <li class="{if condition="(count($menus_curr) egt 1) AND ($menus_curr[0] eq $v['id'])"}active{/if}">
                <a href="{:url($v['name'])}">
                    <i class="fa fa-dashboard"></i><span> {$v['title']}</span>
                </a>
            </li>
            {/if}
            {/volist}
        </ul>
    </section>
    <!-- /.sidebar -->
</aside>
<script>
    function changeVersion(_obj) {
        var url = "{:url('wiki/Index/index')}";
        location.href = url + '?v=' + $(_obj).val();
    }
</script>